package com.xieli.invitesdk

import com.xieli.invitesdk.inviteinterface.OutputInterface
/**
 * @Auther sr
 * @Date 2023/9
 * @Description 单例类，提供输出接口 OutputInterface 的实例
 */
class InviteClass private constructor() {

    // 私有变量，用于存储 OutputInterface 实例
    private var outputInterface: OutputInterface? = null

    companion object {
        private var instance: InviteClass? = null
        // InviteClass 的唯一实例(单例)
        @Synchronized
        fun getInstance(): InviteClass {
            if (instance == null) {
                instance = InviteClass()
            }
            return instance as InviteClass
        }
    }

    // 设置 OutputInterface 实例的(app方初始化设置)
    fun setOutputInterface(outputInterface: OutputInterface) {
        this.outputInterface = outputInterface
    }

  // 获取 OutputInterface 实例
    fun getOutputInterface(): OutputInterface? {
        return outputInterface
    }
}